with open('lambada.jsonl_results.txt' ,'r') as f:
    rows = f.readlines()[1:]
# import pdb;pdb.set_trace()
table = [row.split(',') for row in rows]
table_sorted = sorted(table, key=lambda x: int(x[0]))
ppls = []
accs = []
losses = []
iterations = []

for row in table_sorted:
    print(row[0],row[1][:6],row[2][:6],row[3][:7])

# for row in table_sorted:
#     iterations.append(int(row[0]))
#     losses.append(float(row[1]))
#     accs.append(float(row[2]))
#     ppls.append(float(row[3].strip()))
# # import pdb;pdb.set_trace()
# import matplotlib.pyplot as plt

# # define the table data
# # x_values = [1, 2, 3, 4, 5]
# # y_values = [3.2, 4.1, 5.0, 5.7, 6.4]

# # create a new figure and axis object
# fig, ax = plt.subplots()

# # plot the data as a line plot
# ax.plot(iterations, accs)

# # set the axis labels
# ax.set_xlabel('iteration')
# ax.set_ylabel('acc')
# ax.set_title('Table Plot')

# # show the plot
# fig.savefig('iter-acc.png')
    